package cn.yza.并发.CountDownLatch;

/**
 * @author Honglixi
 * @create 2021-10-09 21:14
 */


public enum CountryEnum {

    ONE(1,"齐"),
    TWO(2,"楚"),
    THREE(3,"燕"),
    FOUR(4,"赵"),
    FIVE(5,"魏"),
    SIX(6,"韩"),
    SEVEVN(7,"jj");
    private Integer id;
    private String username;

    public Integer getId() {
        return id;
    }

    public String getUsername() {
        return username;
    }

    CountryEnum(Integer id, String username) {
        this.id = id;
        this.username = username;
    }
    public static CountryEnum forEach_CountryEnum(int index){
        CountryEnum[] values = CountryEnum.values();
        for (CountryEnum value : values) {
            if (index == value.getId()){
                return value;
            }
        }
        return null;
    }

    public static void main(String[] args) {
        CountryEnum one = CountryEnum.ONE;
        System.out.println(one.getId() + one.getUsername());
    }
}
